Skip to content

Conversation

gavinwade12
Copy link
Contributor

@gavinwade12 gavinwade12 commented Aug 12, 2025

🧭 What and Why

🎟 JIRA Ticket: CMP-485

Add support for the new metadata field on injectedItems and the corresponding _extra field on each hit.

Changes included:

  • Add the metadata property to injectedItems
    • It currently only has a hits property. You can see the full details here.
  • Add the _extra property to hit
    • This contains the metadata specified in injectedItems + an optional _injectedItemKey property

🧪 Test

  • Green CI

@gavinwade12 gavinwade12 requested a review from a team as a code owner August 12, 2025 16:35
@algolia-bot
Copy link
Collaborator

algolia-bot commented Aug 12, 2025

✔️ Code generated!

Name Link
🪓 Triggered by 2b190c046fa9870cf0370707b48d838668c3f778
🍃 Generated commit ce1ac3907c62f88a7a340a675eee789340fd53f4
🌲 Generated branch generated/feat/compositions/injected-item-metadata
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
go 1762
javascript 1663
php 1508
csharp 1299
python 1192
java 969
ruby 849
swift 484
scala 23

@gavinwade12 gavinwade12 changed the title feat(compositions): add fields for metadata in injectedItems feat(specs): add fields for metadata in composition injectedItems Aug 12, 2025
@gavinwade12 gavinwade12 requested a review from a team August 12, 2025 16:38
description: An object that contains the extra key-value pairs provided in the injectedItem definition.
additionalProperties: true
properties:
_injectedItemKey:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the _ to indicate some private fields? could be worth adding it to the description if so

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not meant to be private. I believe we included the _ prefix because every other KV pair in the object is defined by the user, but we conditionally inject this field into the object

@gavinwade12 gavinwade12 force-pushed the feat/compositions/injected-item-metadata branch from 070993d to 8e3f4bb Compare August 14, 2025 16:03
@gavinwade12 gavinwade12 requested a review from shortcuts August 14, 2025 16:03
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@shortcuts shortcuts merged commit 99f8174 into main Aug 14, 2025
29 checks passed
@shortcuts shortcuts deleted the feat/compositions/injected-item-metadata branch August 14, 2025 19:53
algolia-bot added a commit that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-csharp that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-dart that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-go that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-java that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-kotlin that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-php that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-python that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-ruby that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-scala that referenced this pull request Aug 14, 2025
algolia-bot added a commit to algolia/algoliasearch-client-swift that referenced this pull request Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants